package com.example.treasure_back.controller;

import com.example.treasure_back.entity.MsgEntity;
import com.example.treasure_back.model.vo.FriendModel;
import com.example.treasure_back.service.MessageService;
import com.example.treasure_back.shiroEntity.auth.AuthUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/treasure/message")
public class MessageController {
    @Autowired
    private MessageService messageService;

    @RequestMapping("/getFriendList")
    public MsgEntity getFriendList(@AuthUser String email){
        List<FriendModel> friendList = messageService.getFriendList(email);
        return new MsgEntity("SUCCESS","200",friendList);
    }
}
